package com.micheal.spring.demo.controller;

import com.micheal.spring.annotation.Autowired;
import com.micheal.spring.annotation.Controller;
import com.micheal.spring.annotation.RequestMapping;
import com.micheal.spring.annotation.RequestParam;
import com.micheal.spring.demo.service.IDemoService;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Created by micheal on 2018/4/20/0020.
 */
@Controller
@RequestMapping("/demo")
public class DemoController {

    @Autowired
    private IDemoService demoService;

    @RequestMapping("/hello")
    public void hello(HttpServletRequest req, HttpServletResponse resp, @RequestParam("name") String name){

        String hello = demoService.sayHello(name);
        System.out.println(hello);

    }

}
